package com.uplift.common.utils;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.fasterxml.jackson.databind.ObjectMapper;

public class WebMessage {

	private static ObjectMapper om = new ObjectMapper();
	
	public static void sendJsonMessageIgnoreEx(HttpServletResponse response, Object obj) {
		response.setContentType("text/html; charset=utf-8");
		try {
			PrintWriter writer = response.getWriter();
			writer.println(om.writeValueAsString(obj));
			writer.close();
			response.flushBuffer();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
}
